<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="baidu-tc-cerfication"
          content="8f75aa1d017086290b42263df41c1791"/>
    <title>LeisureSeeker 舒客旅行网 - 自助游服务社区</title>
    <meta http-equiv="imagetoolbar" content="no"/>
    <meta name="robots" content="all"/>
    <meta name="keywords" content="自助游,旅行网,旅居线路,舒客,攻略,web2.0"/>
    <meta name="description"
          content="舒客自助旅游网是全球最大的中文Web2.0自助游网站、旅居线路查询预定、自助游服务社区。可查找自由行景点信息和自助游攻略，还可预订旅社客栈与景点打折门票，更可以寻找同伴相约同行，可分享自助游旅程中的照片、视频、游记、点评等旅游记忆。"/>
    <meta name="apple-mobile-web-app-title" content="0"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <c:set value="${pageContext.request.contextPath}" var="path"></c:set>
    <link rel="icon" href="${path}/LeisureSeeker/icons/favicon.ico" sizes="16x16"/>
    <link rel="stylesheet"
          href="/admin/layuiadmin/layui/css/layui.css">
    <link rel="icon" href="/LeisureSeeker/icons/favicon.ico" sizes="16x16"/>
    <link rel="icon" href="/favicon_32x32.ico" sizes="32x32"/>
    <link rel="icon" href="/favicon_128x128.png" sizes="128x128"/>
    <link rel="icon" href="/favicon_256x256.png" sizes="256x256"/>
    <link rel="apple-touch-icon" href="favicon_256x256.png"/>
    <link rel="stylesheet" href="${path}/LeisureSeeker/css/lanrenzhijia.css"/>
    <link rel="stylesheet"
          href="${path}/LeisureSeeker/css/ylj.css">
    <script type="text/javascript" charset="utf-8"
            src="${path}/LeisureSeeker/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" charset="utf-8"
            src="${path}/LeisureSeeker/js/jquery-ui-1.9.2.min.js"></script>
    <script type="text/javascript">
        var $j = jQuery.noConflict();
    </script>
    <script type="text/javascript" charset="utf-8"
            src="${path}/LeisureSeeker/js/yododo.js"></script>
    <script type="text/javascript" charset="utf-8"
            src="${path}/LeisureSeeker/js/prototype.js"></script>

    <script type="text/javascript">
        var _hmt = _hmt || [];
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-145162-2']);
        _gaq.push(['_setDomainName', 'yododo.com']);
        _gaq.push(['_addOrganic', 'google.cn', 'q']);
        _gaq.push(['_addOrganic', 'baidu', 'word']);
        _gaq.push(['_addOrganic', 'baidu', 'wd']);
        _gaq.push(['_addOrganic', 'soso', 'w']);
        _gaq.push(['_addOrganic', 'sogou', 'query']);
        _gaq.push(['_addOrganic', 'youdao', 'q']);
        _gaq.push(['_addOrganic', 'so.360.cn', 'q']);
        _gaq.push(['_addOrganic', 'so.cn', 'q']);
        _gaq.push(['_addOrganic', 'so.com', 'q']);
        _gaq.push(['_addOrganic', '360sou.com', 'q']);
        _gaq.push(['_addOrganic', 'vnet', 'kw']);
        _gaq.push(['_addOrganic', '3721', 'name']);
        _gaq.push(['_addOrganic', 'gougou', 'search']);
        _gaq.push(['_addOrganic', 'sm.cn', 'q']);
        _gaq.push(['_addIgnoredOrganic', '舒客']);
        _gaq.push(['_addIgnoredOrganic', '舒客旅行网']);
        _gaq.push(['_addIgnoredOrganic', '舒客旅游网']);
        _gaq.push(['_addIgnoredOrganic', '舒客网']);
        _gaq.push(['_addIgnoredOrganic', '多多驿站']);
        _gaq.push(['_addIgnoredOrganic', '舒客客栈']);
        _gaq.push(['_addIgnoredOrganic', 'yododo']);
        _gaq.push(['_addIgnoredOrganic', 'youduoduo']);
        _gaq.push(['_addIgnoredOrganic', 'youdodo']);
        _gaq.push(['_addIgnoredOrganic', 'www.yododo.com']);
        _gaq.push(['_addIgnoredOrganic', 'www.yododo.cn']);
        _gaq.push(['_trackPageview']);
        _gaq.push(['_setCustomVar', 1, 'VisitorType', 'Visit', 2]);
        try {
            var ga_cat = location.pathname.match(/^\/([a-z/])+/)[0];
            if (ga_cat) {
                _gaq.push(['_setCustomVar', 4, 'Category', ga_cat, 3]);
            }
        } catch (ga_e) {
        }

        function addTrackEvent(action, opt_label, opt_value) {
            try {
                if (opt_value) {
                    _gaq.push(['_trackEvent', action, opt_label, opt_value]);
                    _hmt.push(['_trackEvent', action, opt_value, opt_value]);
                } else {
                    _gaq.push(['_trackEvent', action, opt_label]);
                    _hmt.push(['_trackEvent', action, opt_label]);
                }
            } catch (e) {
            }
        }
    </script>
    <style type="text/css">


        element.style {
            top: 0px;
        }

        @media screen and (max-width: 980px) {
        }
    </style>
</head>

<body>
<jsp:include page="header.jsp"/>
<script src="http://www.lanrenzhijia.com/ajaxjs/1.8.3/jquery-1.8.3.min.js"></script>
<%--<script src="${path}/LeisureSeeker/js/jquery.custom-select.js"></script>--%>

<script>
    var index = Math.floor(Math.random() * 7);
    var imgs = [
        "${path}/LeisureSeeker/images/1111.jpg",
        "${path}/LeisureSeeker/images/1112.jpg",
        "${path}/LeisureSeeker/images/1113.jpg",
        "${path}/LeisureSeeker/images/1114.jpg",
        "${path}/LeisureSeeker/images/1115.jpg",
        "${path}/LeisureSeeker/images/1116.jpg",
        "${path}/LeisureSeeker/images/1117.jpg"
    ];
    console.log(index);
    var changeImg = function () {
        $('#homebg').css('background-image', 'url(' + imgs[index] + ')');
    }

    function cookiesave(n, v, mins, dn, path) {
        if (n) {
            if (!mins)
                mins = 365 * 24 * 60;
            if (!path)
                path = "/";
            var date = new Date();
            date.setTime(date.getTime() + (mins * 60 * 1000));
            var expires = "; expires=" + date.toGMTString();
            if (dn)
                dn = "domain=" + dn + "; ";
            document.cookie = n + "=" + v + expires + "; " + dn + "path="
                + path;
        }
    }

    function cookieget(n) {
        var name = n + "=";
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ')
                c = c.substring(1, c.length);
            if (c.indexOf(name) == 0)
                return c.substring(name.length, c.length);
        }
        return "";
    }
</script>
<div id="main" class="pdt">
    <div class="topimg">
        <div class="showimg igs">
            <ul class="clearfix">
                <li style="background-image: url(${path}/LeisureSeeker/images/1112.jpg)">
                    <a href="">&nbsp;</a>
                </li>
            </ul>
            <style>
                #tabs {
                    display: block;
                    position: absolute;
                    z-index: 1;
                    left: 50%;
                    bottom: 10px;
                }

                #tabs a {
                    background-color: rgba(255, 255, 255, 0.5);
                    border-radius: 100px;
                    display: inline-block;
                    height: 20px;
                    line-height: 100px;
                    overflow: hidden;
                    width: 20px;
                }

                #tabs a.bg {
                    background-color: rgba(255, 255, 255, 1);
                }
            </style>
        </div>
    </div>
    <div class="listbox">
        <div class="malist w1200">
            <div class="example_2">
                <%--<form class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">请选择城市</label>
                        <div class="layui-input-inline">
                            <select id="province">
                                <option value="4">福建</option>
                            </select>
                        </div>
                        <div class="layui-input-inline">
                            <select id="city">
                                <option value="61">厦门</option>
                            </select>
                        </div>
                        <div class="layui-input-inline">
                            <input class="layui-btn layui-btn-primary" type="button" id="button" value="景点推荐">
                        </div>
                    </div>
                </form>--%>
                <label for="province" style="font-size: 16px">省份:</label>
                <select id="province"
                        style="height: 27px;width: 170px;line-height: 46px;border-radius: 5px;font-size: 16px;border-style: inset;">
                    <option value="4">福建</option>
                </select>
                <label for="city" style="font-size: 16px">城市:</label>
                <select id="city"
                        style="height: 27px;width: 170px;lline-height: 46px;border-radius: 5px;font-size: 16px;border-style: inset;">
                    <option value="61">厦门</option>
                </select>
                <input type="button" id="button" class="btn btn-info" value="查找"
                       style="height: 26px;border-radius: 5px;border-style: outset;">
            </div>
            <strong><span>Leisure Seeker</span></strong>
        </div>
        <div>
            <p class="tcenter ft20 mb30">你来人间一趟，你要看看太阳，和你的心上人，一起走在街上</p>
            <p class="tcenter ft20">了解她，也要了解太阳。</p>
        </div>
        <div class="lm">
            <ul class="clearfix">
                <div id="recommend">
                </div>
            </ul>
            <!-- <a class="button b-xl b-r2 b-center"
                href="http://line.yododo.com/event/search" target="_blank">更多线路</a> -->
        </div>
    </div>
</div>
<script type="text/javascript">
    //<![CDATA[

    try {
        _gaq.push(['_trackEvent', 'ljcom_index_20181128', 'lvju']);
        _hmt.push(['_trackEvent', 'ljcom_index_20181128', 'lvju']);
    } catch (e) {
    }

    //]]>
</script>
<jsp:include page="bottom.jsp"/>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
    var getCity = function () {
        console.log("change");
        var provinceId = "";
        provinceId = $("#province").val();
        if (provinceId == "1") {
            $("#city").find("option").remove();
            var city = document.getElementById("city");
            city.options.add(new Option("请选择", "请选择"));
        } else {
            // 获取市
            $.ajax({
                type: "get",
                url: "../../areaapi/listCity/" + provinceId,
                success: function (data) {
                    var unitObj = document.getElementById("city");
                    var cityName = "";
                    var cityId = "";
                    if (data != null) {
                        $("#city").find("option").remove();
                        for (var i = 0; i < data.length; i++) {
                            cityName = data[i].cityName;
                            cityId = data[i].cityId;
                            unitObj.options.add(new Option(cityName, cityId));
                        }
                    }
                }
            })
        }
    }
    $(document).ready(function () {
        getCity();
        // 获取省
        $.ajax({
            type: "get",
            url: "../../areaapi/listProvince",
            success: function (data) {
                var unitObj = document.getElementById("province");
                var provinceName = "";
                var provinceId = "";
                if (data != null) {
                    for (var i = 0; i < data.length; i++) {
                        provinceName = data[i].provinceName;
                        provinceId = data[i].provinceId;
                        unitObj.options.add(new Option(provinceName, provinceId));
                    }
                }
            }
        })
    });
    $("#province").change(function () {
        console.log("change");
        getCity();
    });
    var f = function () {
        var provinceId = $("#province").val();
        var cityId = $("#city").val();
        if (cityId == "null") {
            console.log("null");
            cityId = "";
        } else {
            console.log("nonull");
        }
        console.log(provinceId + "," + cityId);
        $.ajax({
            type: "get",
            url: "../../pjson",
            dataType: 'jsonp',
            data: {
                pid: provinceId,
                cid: cityId,
                /*page:'1',
                key:'b4001a9c860a4f97a8d222e89d405555'*/
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                console.log("error");
            },
            success: function (data) {
                $("#recommend").empty();
                var x = 1000;
                var y = 500;
                var rand = 0;
                if (data.result != null) {
                    for (var i = 0; i < data.result.length; i++) {
                        rand = parseInt(Math.random() * (x - y + 1) + y);
                        if (data.result[i].grade == "") {
                            data.result[i].grade = "AAAAA";
                        }
                        if (data.result[i].price_min == "0") {
                            data.result[i].price_min = "60";
                        }
                        $("#recommend").prepend("<li><a href=\"/scenicDetails?pid=" + provinceId + "&cid=" + cityId + "&sid=" + data.result[i].sid + "\" target=\"_blank\">\n" +
                            "                    <div class=\"simg\"\n" +
                            "                         style=\"background-image: url(" + data.result[i].imgurl + ")\">\n" +
                            "                        <div>\n" +
                            "                            <strong>" + data.result[i].grade + "</strong> <span>" + data.result[i].title + "</span>\n" +
                            "                        </div>\n" +
                            "                    </div>\n" +
                            "                    <p>" + data.result[i].address + "</p> <span></span>\n" +
                            "                    <p class=\"clearfix\">\n" +
                            "                        <strong> <i>&yen;" + data.result[i].price_min + "</i>起\n" +
                            "                        </strong> <span><i>" + rand + "</i>人参加&nbsp;&nbsp;|&nbsp;&nbsp;<i>" + data.result[i].sid + "</i>人关注</span>\n" +
                            "                    </p>\n" +
                            "                </a></li>")
                    }
                } else {
                    $("#recommend").prepend("<li><a href=\"\" target=\"_blank\">\n" +
                        "                    <div class=\"simg\"\n" +
                        "                         style=\"background-image: url()\">\n" +
                        "                        <div>\n" +
                        "                            <strong>暂无景区推荐</strong> <span>无</span>\n" +
                        "                        </div>\n" +
                        "                    </div>\n" +
                        "                    <p>无</p> <span></span>\n" +
                        "                    <p class=\"clearfix\">\n" +
                        "                        <strong> <i>&yen;0</i>起\n" +
                        "                        </strong> <span><i>0</i>人参加&nbsp;&nbsp;|&nbsp;&nbsp;<i>0</i>人关注</span>\n" +
                        "                    </p>\n" +
                        "                </a></li>")
                }
            }
        })
    }
    $('#button').on('click', function () {
        f();
    });
    $(function () {
        f();
    })
</script>
<%--<script src="/admin/layuiadmin/layui/layui.js"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
    });
</script>--%>
</html>